﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using WJ.Infrastructure.Data;

namespace WJ.Infrastructure.DDD
{
    public interface IQuery<TEntity> where TEntity : IEntity
    {
        TEntity GetOne(Expression<Func<TEntity, bool>> condition);

        PageData<TEntity> GetList(Expression<Func<TEntity, bool>> condition, int pagesize, int pageindex, bool istotal);

        List<TEntity> GetList(Expression<Func<TEntity, bool>> condition);

        bool Exists(Expression<Func<TEntity, bool>> condition);

        List<TEntity> TopN(Expression<Func<TEntity, bool>> condition, int topN);

        IQueryable<TEntity> GetListQuery(Expression<Func<TEntity, bool>> condition);

        IQueryable<TEntity> GetQueryable();
    }
}
